﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GestionePolveriLib.BL.Reports
{
    public class Report521
    {
        public long? IDLotto { get; set; }
        public string CodicePolvere { get; set; }
        public IQueryable<Dati_Associati> DatiAbbinati { get; set; }
        public string Famiglia { get; set; }
        public double? Giacenza { get; set; }
        public double? PrezzoUnitario { get; set; }
        public DateTime? DataDdt { get; set; }
        public string NumDdt { get; set; }
        public string CodLotto { get; set; }
        public int NumScatole { get; set; }

        public string CodLottoCarico { get; set; }
        public string CodLottoScarico { get; set; }
        public int GiacenzaScatole { get; set; }
        public double Valore { get; set; }

        public double TotCarico { get; set; }
        public double TotScarico { get; set; }
        public string CodiceCausale { get; set; }
        public double? Quantita { get; set; }

        public string ColoriAbbinati
        {
            get
            {
                string retValue = string.Empty;

                if (DatiAbbinati != null)
                {
                    DatiAbbinati.ToList().ForEach(x => retValue += x.ColoriAbbinati);

                    int i = retValue.LastIndexOf(",");

                    retValue = retValue.Substring(0, i);
                }

                return retValue;
            }
        }

        public Report521()
        {

        }
    }
}
